﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace EntitySetBase
{
    public abstract class EntitySetWithCreateAndUpdate : EntitySetWithCreate, IEntitySetWithCreateAndUpdate
    {
        [Column("updated_by"), Required, MaxLength(36)]
        public string UpdatedBy { get; set; }
        [Column("updated_on"), Required]
        public DateTime UpdatedOn { get; set; }
        [Column("description"), MaxLength(256)]
        public virtual string Description { get; set; }

        public virtual void Update(string updatedBy = null)
        {
            UpdatedBy = updatedBy;
            UpdatedOn = DateTime.Now;
        }
    }
}
